#include<iostream>
using namespace std;
int n, m;
int main()
{
	int	t;
	cin >> t;
	while (t--) {
		cin >> n >> m;
		cout << n - m + 1 << endl;
	}
	return 0;
}